<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>calcReleaseNotes</title>
</head>

<body bgcolor="#FFFFFF">

<h1 align="center">calc Release Notes</h1>

<h2 align="center">Release 3-7-5</h2>
<ul>
<li>All autoconverted op files updated
</ul>

<h2 align="center">Release 3-7-4</h2>
<ul>
<li>Converted adl files to bob and edl</li>
<li>IOC shell files now located in calcApp/iocsh and are installed to top-level iocsh folder</li>	
</ul>	
	
<h2 align="center">Release 3-7-3</h2>
<ul>
<li>Db files now all get installed to top-level db folder</li>
</ul>
	
<h2 align="center">Release 3-7-2</h2>

<ul>
<li>EPICS v7 compatability changes
<li>Errors in OCAL expression now set OVAL to -1 instead of VAL
</ul>

<h2 align="center">Release 3-7-1</h2>
<ul>
<li>aCalcout now posts monitors and archive monitors for AVAL and OAV if one or
    more their elements changes by more than MDEL or ADEL.
</li>
</ul>

<h2 align="center">Release 3-7 (12/5/2017)</h2>
<ul>
<li>seq and sseq record displays now expose the SELL, SELN, and SELM fields,
and related .req files autosave those fields.
<li>Made sCalc and aCalc header files public.
<li>Modified sseqRecord_settings.req to restore DOn before STRn, because the
sseq record modifies both when either is written, and this messes up runtime
restore (manual restore or configMenu restore).  Test: set STRn to "1!", save
and restore.  Without the fix, STRn gets restored as "1".

<li>Modified the scalcout record's treatment of null characters in strings
received from DBF_CHAR and DBF_UCHAR PVs.  Previously, one or more trailing
"\000" fragments were appended (by epicsStrSnPrintEscaped) to the string.
These fragments are now stripped.

<li>Added iocsh directory, and populated with scripts callable from st.cmd

<li>userArrayCalcs10more_settings.req had incorrect Enable PV

<li>fix verious .adl files for better translation with adl2ui

<li>remake all ui files with adl2ui from caqtdm 4.1.3

<li>userStringCalcs10.db: Update SDIS links to include individual and global enable/disable

<li>Added acalc and scalc unit tests

<li>array calcs monitor and display allocated memory

<li>sCalcoutRecord.c: strcpy -> strNcpy; strcmp -> strncmp; paddr->field_size = STRING_SIZE changed to paddr->field_size = 1 in cvt_dbaddr()

<li>Changed order of STR* and DO* in sCalcout request file, so manual restore
works (string value overrides numeric value).

<li> Fixes to compile with Visual Studio 2010

<li> aCalcTest.cpp: Restored powl, atan2l, sqrtl to pow, atan2, sqrt; change
first arg to double to eliminate errors on Windows.

<li> Update CONFIG to use CONFIG_SITE.

</ul>

<h2 align="center">Release 3-6-1</h2>
<ul>
<li>Fixed aCalcoutRecord.html, sCalcoutRecord.html, and transformRecord.html so
that they specify the correct size of calc-expression fields.
</ul>

<h2 align="center">Release 3-6</h2>
<ul>
<li>Restored yySseq.db, added yySseq_settings.req.
</ul>

<h2 align="center">Release 3-5</h2>
<ul>

<li>usercalcs now have a global enable, a usercalc-type enable, and individual
enables.

<li>calc.iocsh (in iocBoot/iocCalc) is now the preferred way to load usercalcs.

<li>transformRecord: any nonwhitespace character is now permitted in a variable
name

<li>sseq_settings.req is deprecated.  Use sseqRecord_settings.req instead.

</ul>

<h2 align="center">Release 3-4-2-1</h2>
<ul>
<li>Not all userCalc displays use $(C); some use $(S).  Specify both
</ul>

<h2 align="center">Release 3-4-2</h2>
<ul>
<li>/userXXX10more_bare.adl specified macro C, but sseq displays need S
</ul>

<h2 align="center">Release 3-4-2</h2>

<ul>
<li>calc was adding editSeq.dbd to calcSupport.dbd even when SNCSEQ wasn't defined in RELEASE

<li>sseq record: previously, sseq could segfault when .WAIT=="After&lt;n&gt;".
Thanks to Matt Pearson for finding and characterizing the problem.
</ul>

<h2 align="center">Release 3-4-1</h2>

<ul>

<li>scalcout record: conversion from numeric expression result to string now
honors the PREC field.

<li>editSseq: new support for editing sseq and seq records at run time. 
editSseq allows user to move a sseqRecord <i>line</i> up or down, or to swap two
lines. (A <i>line</i> is the set (DLYn, DOLn, STRn, DOn, LNKn, WAITn).)

<li>calc now requires the seq module by default.  If the seq module is not
available, the definition of SNCSEQ must be commented out of configure/RELEASE,
and calc will then build everything but editSseq.  This version of calc will
build with either seq-2-1-18 or seq-2-2-1.

<li>calc.dbd: new file, which is exactly the same as calcSupport.dbd.


</ul>

<h2 align="center">Release 3-4</h2>

<ul>
<li>acalcout record: new functions, better treatment of subranges:
<ul>
<li>IXMAX: index of largest array element
<li>IXMIN: index of smallest array element
<li>IXZ: index of first zero crossing in array
<li>IXNZ: index of first nonzero array element
<li>FITQ, FITMQ: fit to quadratic and optionally return fit coefficients. 
(Replacements for deprecated FITPOLY, FITMPOLY.)
<li>CAT: concatenate array subranges, or an array subrange and a double.

<li>operators <code>^</code> and <code>**</code> reimplemented to permit
noninteger exponents.


<li>acalcout expressions now maintain array extents on the stack, so, for
example, the expression <code>avg(aa[1,10])</code> really is an average of just
<code>aa[1,10]</code>.  Previously, <code>avg(aa[1,10])</code> actually
performed <code>sum(aa[1,10])/arraySize</code>.  Now it does
<code>sum(aa[1,10])/10</code>.

</ul>
<li>scalcout and transform records: operators <code>^</code> and <code>**</code> reimplemented to permit
noninteger exponents.

<li>use Perl's ExtUtils::Command to concatenate .dbd files, instead of local
cat.pl. Left old stuff in place, for now, in case someone has a problem with the
new method.

<li>Minor improvements in interp

<li>When an scalcout fails to fetch a string field, give an informative error message.

</ul>

<h2 align="center">Release 3-3</h2>

<ul>
<li>The transform record now supports expressions with user-specified variable
names.  For example, instead of the expression "a-b/2", you could arrange to
write "$center+$size/2".  Variable names are specified using the CMTx fields.
The sizes of calc fields have been increased from 80 to 120 to better accommodate
variable names.

<li>Make it easier to add 10 more usercalcs by writing, e.g.,
userCalcouts10more.db

<li>scalcout: fix for enum fields in R2-9 broke the code that checks if links are
ok.  This is now fixed.

</ul>

<h2 align="center">Release 3-2</h2>
<ul>

<li>Added CUM function to calculate running sum of array elements.  Example: if
AA=(1,2,3), CUM(AA) = (1,3,6).  This function is useful for integrating
multichannel scaler arrays of motor steps into relative motor positions.

<li>Previously, when fetching array values from input links, the number of
elements requested was not initialized before each call to dbGetLink().  If
dbGetLink() reported a smaller number of elements, that number was used in
subsequent calls to dbGetLink().

<li>Previously, the arguments of the @ and @@ operators were not thoroughly
range checked.  Also, a subexpression like "@-a:=2" was executed as "@a:=-2"
because the := operator failed to move operators of >= priority out to the
postfix buffer.

<li> Added display files for caQtDM

</ul>

<h1 align="center">calc Release Notes</h1>
<h2 align="center">Release 3-1</h2>
<ul>

<li>Previously, only a single acalcout record could evaluate an expression at a
time, because aCalcPerform() was not reentrant, because it used a global value
stack.  Now aCalcPerform allocates a new  value stack for each expression
evaluation, using EPICS' freeList.  aCalcPerform manages an array of EPICS
freeLists, selecting an appropriately sized list if possible, making a new one
if an unclaimed list entry exists, commandeering the least recently used list
with no outstanding allocations, or reporting failure.  As a consequence, the
iocshell variable <code>aCalcArraySize</code> is no longer needed and no longer
exists.

<li>Previously, acalcout expression evaluation always occurred in the
record-processing thread, regardless of how long expression evaluation was
expected to take.  (On solaris, evaluations with million-element arrays can
easily take over a second.)  Now, acalcout records queue expression evaluation
to a separate thread, for array sizes larger than
<code>aCalcAsyncThreshold</code> (default: 10000).

<li>Previously, acalcout records reported NUSE as the array size on the initial
connection by a link or channel-access client.  Now the size can be reported
either as <code>NELM</code> (the default), or as <code>NUSE</code>, depending on
the value of the record's <code>SIZE</code> field, which can be either "NELM" or
"NUSE".  "NELM" always works, but is in some cases less efficient than "NUSE". 
If "NUSE" is selected, the link or channel must be closed and reestablished when
the record's <code>NUSE</code> field increases.

<li>arrayCalc plot displays (MEDM files only, for now) now use NUSE to specify
the array size.  This requires an additional macro (C, the record name) to be
supplied when launching those displays.

<li>All userCalcs of one kind (i.e., userTransforms10.db, userArrayCalcs10.db,
etc.) have since EPICS 3.14 been in the same lock set, because they connected
via NPP links to a common enable PV.  Now, userCalcs are enabled via CA links.

<li>Previously, the acalcout record calculated OVAL and OAV from CALC, instead
of from OCAL.

<li>In calc R3-0, the array operators <code>fitmpoly</code>, <code>nderiv</code>,
<code>nsmoo</code> were broken because they had incorrect stack-effect numbers.

<li>In calc R3-0, for both acalcout and scalcout records, stores to
input-variable fields specified using the "@" and "@@" operators were wrongly
coded for some expressions.

<li>  Previously, the expression "a?1;b:=0:0" produced a evaluation-time error
if a==0.  Actually, it <i>is</i> an error to have a store expression not at top
level and not within parentheses, but postfix doesn't catch it, and anyway it's
pretty easy to do the expected thing in this case.  Note that it's not possible
to do the expected thing in the case "a?1:0;b:=0", because we can't know whether
"(a?1:0);b:=0" or "a?1:(0;b:=0)" was intended.

<li>Previously, the sseq record used database access to get the properties of a
local PV it linked to, even if it was making a CA link to that PV.  Also, the
sseq record failed to update the status of an input link that had changed from a
CA link to a DB link.

<li>Previously, userCalc collections were enabled by a record whose value was
undefined until the enable state was changed.  Now the enables are made to be
defined in the database file: field(UDF, "0"), field(STAT, "NO_ALARM"),
field(SEVR, "NO_ALARM")

</ul>

<h2 align="center">Release 3-0</h2>
<ul>

<li>In all .adl files displaying calc expressions, the expression widget has
been  modified to have '$' appended to PV name, and to have the attribute
'format=string'.  <b>The trailing '$' character will confound MEDM versions
earlier than 3-1-7, which assume '$' begins a macro substitution.</b>

<li>Modified scalcout, transform, swait, and acalcout records to use 80-character
expression fields.  Modified associated autosave-request files to handle these
fields by appending '$' to the field name.  <b>Note that autosave R5-0 or higher is
required to save and restore these fields.</b>

<li>Modified interp.c and interpNew.* software to support interpolating an
array of values to produce an array of results.  The interpolation of scalars
and arrays uses the same interpolation tables and polynomial order.

<li>The sseq record (and related databases, etc) was moved from the std module
to the calc module, along with all of its databases, request files, and display
files. <b>Command files that load userStringSeqs10.db must be modified to reflect
its new location.</b> 

<li>The sseq record now notifies the user if a WAITn field is inconsistent with the
link attribute specified for the associated LNKn field.  (If WAITn, then LNKn
must be a CA link.)

<li>The unary operator "NOT" should always have meant logical NOT, but actually
has been implemented as unary negative.  Now, "NOT" and "!" both mean logical
NOT.

<li>Rewrote string and array calcs following Andrew Johnson's new model for the
calc software in EPICS base.  This model does a more robust job of handling
functions with a variable number of arguments, and permits expressions to store
values to input variables.  I departed slightly from the model to permit store
operations at other than top level, which allows them to be made conditional. 
This permitted the addition of the looping function "UNTIL".  String and array
calcs now export the variables sCalcLoopMax and aCalcLoopMax, respectively, to
limit the number of iterations of UNTIL loops.

<li><b>WARNING! NON-BACKWARD-COMPATIBLE CHANGE:</b><br>

Fixed the array calc {} (subrange in place) operator to treat array indices as
documented - exactly as the [] (subrange) operator treats them.  Previously, for
example, aa{0,n} was not the same as aa[0,n], but instead performed aa{0,n-1}.

<li>Renamed aCalcoutRecord's NEW field as NEWM, to avoid conflict with c++ reserved word

<li>Added python program test_aCalc.py to test array calcs.  The program uses pyepics to talk to
an acalcout record.  Modified test_sCalc.py to use pyepics.


</ul>

<h2 align="center">Release 2-9</h2>
<ul>

<li>Dropped backward compatibility with genSub record

<li>sCalcout record:
	<ul>

	<li>now treats arrays of DBF_CHAR, DBF_UCHAR as strings

	<li>now checks CA string-input link by calling dbGetLink(), to defend
		 against failure resulting from enum strings not having arrived before
		 first call.

	<li>fixes for 64-bit arch (Thanks to Lewis Muir and Andrew Johnson)

	<li>Some additions to test_sCalc.py
	
	<li>Previously, if the OCAL expression evaluation produced an error, the
	    record set SVAL, instead of OSV, to '***ERROR***'.

	</ul>

<li>Added .opi display files for CSS-BOY

<li>Added some missing logical and bitwise operators to calcExamples.* displays

<li>Added BURT array-load example to interp.README

<li>Added interpNew, a better version of interp.

</ul>

<h2 align="center">Release 2-8</h2>
<ul>

<li>Modified subAve.c (which supports userAve10.db) to add two algorithms: a
line fit, selected by setting the sub record's .F field to 1, and a modified
line fit, in which the calculated slope is multiplied by the correlation
coefficient (.F ==2).  These algorithms fit recorded values, seen as a function
of the time they were recorded, to a line, and return the line evaluated at the
time the most recent input value was recorded.  This is nearly the same as
taking the average, if the input signal's true value is constant.  But if the
input signal varies with time, a line fit can yield a better estimate of the
true current value.  This is particularly useful when the smoothed value is
needed in a PID loop.

<li>subAve.c had fixed 10,000 element buffer.  Now it starts with 100 elements
	and grows as needed to as many as 100,000 elements.

<li>userAve10.db, userAve.adl - modifications to add subAve.c's new line-fit
	algorithm.  Modifications to allow clients easily to acquire an averaged
	value (for example, in a scan) by writing to an "acquire" PV.  Clients
	that use ca_put_callback to start acquisition will receive a callback when
	the specified number of readings have been averaged.

<li>Modified sCalc support to add the function nrndm, a pseudorandom number
normally (i.e., bell curve) distribed about zero, with a standard deviation of
one.  This affects sCalcout and transform records.

<li>Fixed a bug in the sCalcoutRecord (thanks to Lewis Muir for finding and
diagnosing the problem).  The record was not in all cases checking that an
input link had one of the supported types before before using it to fill the
associated value field.  As a result, a link to a DBF_CHAR or DBF_UCHAR PV
would clear the following link's value field.

<li>Fixes for EPICS 3.14.11, notably, adding errlog.h

<li>Added FLNK to swait_settings.req (the 'userCalc' record)

<li>Added a simple soft function generator (sine square triangle), FuncGen*

<li>sCalc's max() and min() functions fixed for 64-bit architecture.  This
fixes sCalcoutRecord, transformRecord, and swaitRecord.

</ul>

<h2 align="center">Release 2-7</h2>
<ul>
<li>Instead of the genSub record, the calc module now uses the aSub record
in EPICS base (3.14.10 and higher).  Thanks to Eric Norum for detailing the
required changes.
<li>transform record exports transformRecordDebug, and calcSupport.dbd names it.
<li>new .adl files yyArrayCalc*.adl
<li>CalcRecord*.adl: deleted link-valid fields, which don't exist for calc record.
<li>sCalcPerform now returns an error if the sscanf function fails to convert.
<li>the sCalcout record now sets VAL==-1 and SVAL == "***ERROR***" if sCalcPerform
returns an error.
</ul>

<h2 align="center">Release 2-6-7</h2>
<ul>

<li>Use new linkHelp displays (from std module) in displays that have links

</ul>

<h2 align="center">Release 2-6-6</h2>
<ul>

<li>The aCalcout record was not handling alarms correctly, Peter Mueller fixed it.

<li>calcDocs.html now describes the databases, autosave-request files, and
MEDM-display files in the calc module.

<li>Added a set of user-transform record that are individually enabled/disabled.

</ul>

<h2 align="center">Release 2-6-5</h2>
<ul>
<li>The sCalcout record now supports the function, "len()", which returns the
length of its argument *converted to string, if necessary).
<li>Made the build sensitive to the modules in configure/RELEASE, so people
don't have to get a copy of sscan and gensub just to use, say, the sCalcout
record.  calcSupport.dbd and libcalc will include whatever calc was able to
build, and this is determined by what modules are named in configure/RELEASE.
<li>For sCalcout and aCalcout records, fixed check of outlink (if link to link
field, or if .WAIT, then outlink attribute must be CA).
</ul>

<h2 align="center">Release 2-6-4</h2>
<ul>
<li>The transform record can now use both the input link and the expression to
find a new value for a value field.  This is enabled by the COPT (calc option)
field.  With the default value of COPT, "Conditional", the presence of the input
link INPA precludes evaluation of the expression CLCA.  This is the way the
transform record has always worked in the past.   With COPT="Always", all
expressions are evaluated, whether or not the corresponding input link exists. 
(As before, all input links execute before any calculations are performed.)
<li>Minor changes to some display and documentation files.
</ul>

<h2 align="center">Release 2-6-3</h2>
<ul>
<li>array calcs reworked to allocate arrays only as needed.
<br>aCalcPerform
allocates no stack space until it is called.  Then, it allocates 20
arrays of length aCalcArraySize (a volatile int, settable from the shell)
or the arraySize argument specified by the first caller, whichever is
larger.
<br>aCalcoutRecord allocates an NELEM-size array for each variable AA-LL,
when that variable is first read from or written to.
<li>swaitRecord's .CALC field defaults to "0" instead of "", because ""
will not be legal in EPICS 3.13.9.
</ul>

<h2 align="center">Release 2-6-2</h2>
<ul>
<li><p>Added the following functions for the aCalcout record
<dl>
<dt>DERIV <dd>take derivative (with respect to element number)
<dt>FITPOLY <dd>fit to 2nd order polynomial
<dt>FITMPOLY <dd>masked fit to 2nd order polynomial
<dt>NSMOO <dd>apply smoothing operator a specified number of times
</dl>
<li>reworked medm displays that describe calc expressions
<li>reworked medm displays for aCalcout record
<li>fixed swaitRecord docs
</ul>

<h2 align="center">Release 2-6-1</h2>
<ul>
<li><p>sCalcout and aCalcout records were not calling device support's
init_record() routine
<li><p>Added FWHM function to array calc support.
</ul>

<h2 align="center">Release 2-6</h2>
<ul>
<li><p>Added array calc support.  This generalizes EPICS standard calc support
in much the same way that the string calc support did, but with arrays
instead of strings.

<li><p>Added a python program to test string-calc software.

<li><p>Interp support uses different genSub-record fields, and has acquired a mode switch
and a success indicator.  See calc/documentation/interp.README.

<li><p>sCalcout record has two new functions:
<ul>
<li>TR_ESC() translates escape sequences into the characters they represent
<li>ESC()    translates selected unprintable characters into escape sequences.
</ul>
</ul>

<h2 align="center">Release 2-4</h2>

This version is intended to build with EPICS base 3.14.7.

<ul>
<li><p>interp.c, interp.db, interp.adl - no longer supports spline
interpolation. Array length no longer limited to 2000 elements.  Added range
checking.  Now the number of elements must be specified at load time, with the
macro, N.  Polynomial order is now forced to be in [0..10].
<li><p>All databases have been converted to vdct.
<li><p>Swait-record documentation added
<li><p>New string operators '-|' and '|-' (delete first/last occurrence of
substring).
<li><p>Added arrayTest.c, a gensub-based support for producing unique
arrays at runtime, e.g., for verifying that sscanRecord/saveData are
storing data exactly as it was acquired.  Also added arrayTest.db and
arrayTest.adl.
<li><p>Complete list of stringCalc functions, operators, and
constants, with examples, is available as a set of medm displays,
starting with the top-level display "calcExamples.adl".  All medm
displays that display calc expressions call up these doc displays.
<li><P>stringCalc record now uses device support.  Supplied soft device
support allows the user to specify whether or not to wait for completion
of the operation started by the OUT link.
<li><P>EPICS base no longer contains the code required to check calc
expressions for the sCalcout and transform records at boot time or DCT
time.  (At run time, the expressions are checked by sCalcPostfix.)
<li><P><a href="cvsLog.txt">cvs log</a>
</ul>

<h2 align="center">Release 2-3</h2>

<p align="left">This is the first release of the synApps calc module.
Version numbering for this module begins with 2.3 because this module
was split from version 2.2 of the std module, and I wanted to retain
the CVS histories of module contents.</p>

This version is intended to build with EPICS base 3.14.5.

Differences from software as previously released in std 2.2:
<ul>
<li><p>interp.c, interp.db, interp.adl - now supports spline and
polynomial interpolation.
<li><p>subAve.c - registry stuff


<address>
    Suggestions and Comments to: <br>
    <a href="mailto:mooney@aps.anl.gov">Tim Mooney </a>:
    (mooney@aps.anl.gov) <br>
    Last modified: December 22, 2004 
</address>
</body>
</html>
